unit UdmKernel_Gerencial;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, UdmKernel_Base, FMTBcd, DBClient, Provider, DB, SqlExpr;

type
  TdmKernel_Gerencial = class(TdmKernel_Base)
    qryPesqBase: TSQLQuery;
    dspPesqBase: TDataSetProvider;
    cdsPesqBase: TClientDataSet;
    qryLstAux: TSQLQuery;
    dspLstAux: TDataSetProvider;
    procedure DataModuleCreate(Sender: TObject);
  private
    { Private declarations }
  public
    {Fomata com mascara de valor todos os fields de valor}
    procedure kernel_Formata_Fields_Valores;
  end;

var
  dmKernel_Gerencial: TdmKernel_Gerencial;

implementation

uses UdmPrincipal;

{$R *.dfm}

{ TdmKernel_Gerencial }

procedure TdmKernel_Gerencial.DataModuleCreate(Sender: TObject);
begin
  inherited;
  kernel_Formata_Fields_Valores;
end;

procedure TdmKernel_Gerencial.kernel_Formata_Fields_Valores;
var
  I, J: Integer;
begin
  for I := 0 to ComponentCount - 1 do
  begin
    if Components[I] is TDataSet then
      begin
        with TDataSet(Components[I]) do
        begin
          for J := 0 to Fields.Count - 1 do
          begin
            if (Fields[J] is TFloatField) or (Fields[J] is TBCDField) or (Fields[J] is TFMTBCDField) then
              begin
                TNumericField(Fields[J]).DisplayFormat := '##,###,##0.00';
              end;
          end;
        end;
      end;
  end;

end;

end.
